<template>
	<view class="logistics">
		<view class="commodityBox">
			<view class="number">订单编号：<text>{{order_no}}</text></view>
			<view class="commodity" v-if="false">
				<u-image width="140rpx" height="140rpx" src="http://xcx.tfxiaochengxu.com/2021-01-30_6015247ca13df.jpg"></u-image>
				<view class="info">
					<view class="title u-line-2">【范里奇奇】烟酰胺果酸身体乳*2瓶</view>
					<view class="piece">1件</view>
				</view>
			</view>
			<view class="bottomBox">
				<view class="item">
					运单号：
					<text>{{express_order_no}}</text>
					<view class="copy" @click="copyEvent(express_order_no)">复制</view>
				</view>
				<view class="item">物流公司：<text>{{express_company}}</text></view>
			</view>
		</view>
		
		<view class="logisticsBox mTop2">
			<u-time-line>
				<u-time-line-item nodeTop="8" v-for="(item, index) in logistics" :key="index">
					<template v-slot:node>
						<view class="u-node"></view>
					</template>
					<template v-slot:content >
						<view>
							<view class="u-order-title" v-if="false">运输中</view>
							<view class="u-order-time">{{item.time}}</view>
							<view class="u-order-desc">{{item.context}}</view>
						</view>
					</template>
				</u-time-line-item>
			</u-time-line>
		</view>
	</view>
</template>

<script>
	const util = require('common/util.js');
	export default {
		data() {
			return {
				logistics:[0, 1],
				order_no:"",
				express_order_no:"",
				express_company:""
			}
		},
		onLoad (e) {
			this.order_no = e.order_no;
			this.express_order_no = e.express_no;
			this.express_company = e.express_company;
			this.logistics = JSON.parse(e.position_json);
		},
		methods: {
			copyEvent(content){
				uni.setClipboardData({
					data: content,
					success() {
						uni.showToast({
							icon: 'none',
							title: '复制成功'
						})
					}
				})
			},
		}
	}
</script>

<style scoped lang="scss">
.logistics {
	min-height: 100%;
	background-color: var(--bgColor);
}

.commodityBox {
	padding: 24rpx;
	background-color: #FFFFFF;
	.number {
		color: #999999;
		font-size: 28rpx;
		text {
			color: #333333;
		}
		margin-bottom: 20rpx;
	}
	.commodity {
		display: flex;
		padding: 20rpx 0;
		.info {
			color: #666666;
			margin-left: 20rpx;
			display: flex;
			flex-direction: column;
			justify-content: space-between;
			.title {
				font-size: 28rpx;
				color: #333333;
			}
			.piece {
				font-size: 24rpx;
				color: #999999;
			}
		}
	}
	.bottomBox {
		border-top: 1px solid #EEEEEE;
		.item {
			color: #999999;
			font-size: 28rpx;
			margin-top: 8rpx;
			text {
				color: #333333;
				vertical-align: middle;
			}
			.copy {
				display: inline-block;
				border: 1rpx solid #999999;
				border-radius: 20rpx;
				font-size: 20rpx;
				margin-left: 8rpx;
				padding: 0 8rpx;
				vertical-align: middle;
			}
			&:last-of-type {
				text {
					color: var(--primaryColor);
				}
			}
		}
	}
}

.logisticsBox {
	background-color: #FFFFFF;
	padding: 24rpx;
}

.u-time-axis{
	margin-top: 20rpx;
	padding-left: 48px;
	padding-right: 32rpx;
	border: none;
}
.u-node {
	padding: 8rpx;
	border-radius: 100rpx;
	display: flex;
	justify-content: center;
	align-items: center;
	background: #d0d0d0;
}
.u-order-title {
	color: #333333;
	font-weight: bold;
	font-size: 28rpx;
	&.unacive {
		color: rgb(150, 150, 150);
	}
}
.u-order-desc {
	color: #666;
	font-size: 28rpx;
	margin-top: 6rpx;
}
.u-order-time {
	color: rgb(200, 200, 200);
	font-size: 26rpx;
}
.tel {
	color: #2979ff;
}
</style>
